//
//  DetailZhuanTiViewController.m
//  TravelYo
//
//  Created by lanou3g on 15/10/27.
//  Copyright © 2015年 TravelYo. All rights reserved.
//

#import "DetailZhuanTiViewController.h"

@interface DetailZhuanTiViewController ()<UIWebViewDelegate>

@property (nonatomic, retain) UIWebView *webView;
@end

@implementation DetailZhuanTiViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationController.navigationBar.translucent = NO;
    
    
    [self setUpData];
    
    
}


- (void)setUpData
{
    _webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
    // 允许交互
    _webView.userInteractionEnabled = YES;
    _webView.scrollView.bounces = YES;
    _webView.delegate = self;
    [self.view addSubview:_webView];
    
    
    NSURL *url = [NSURL URLWithString:_url];
    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [_webView loadRequest:request];
    
    
}

//代理方法
// 开始加载
- (void)webViewDidStartLoad:(UIWebView *)webView
{
    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    [MBProgressHUD hideHUDForView:self.view animated:YES];
}

// 加载完成
- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    [MBProgressHUD hideHUDForView:self.view animated:YES];
}


// 加载失败
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
    [MBProgressHUD hideHUDForView:self.view animated:YES];
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
